package demo3;

import java.util.Locale;

public class Test {
    public static void main(String[] args) {
        String str1 = "heLLO";
        String str2 = "WorLD";

        System.out.println(str1.toLowerCase());
        System.out.println(str2.toLowerCase());
    }
    public static void main7(String[] args) {
        String str1 = String.valueOf(1234);
        String str2 = String.valueOf(3.14);

        System.out.println(str1);
        System.out.println(str2);
    }
    public static void main6(String[] args) {
        String str = new String("hello");
        int index = str.lastIndexOf("ll",2);
        System.out.println(index);
    }
    public static void main5(String[] args) {
        String str = new String("hello");
        int index = str.indexOf("ll",3);
        System.out.println(index);
    }
    public static void main4(String[] args) {
        String str = new String("hello");
        int length = str.length();

        int[] arr = {1,2,3};
        int length2 = arr.length;
    }
    public static void main3(String[] args) {
        String str = "hello";
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            System.out.print(ch + " ");
        }
    }
    public static void main2(String[] args) {
        String str1 = new String("hello");
        String str2 = new String("hello");
        String str3 = new String("HELLO");
        String str4 = new String("HellO");
        String str5 = new String("Hello汉字world");
        String str6 = new String("hello汉字WORLD");

        System.out.println(str1.compareToIgnoreCase(str2));
        System.out.println(str1.compareToIgnoreCase(str3));
        System.out.println(str1.compareToIgnoreCase(str4));
        System.out.println(str5.compareToIgnoreCase(str6));
    }
    public static void main1(String[] args) {
        String str1 = "hello";
        String str2 = "hello";
        char[] arr = {'a','b','c','d'};
        String str3 = new String(arr);

        /*System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);*/

        System.out.println(str1 == str2);

    }
}
